home *** CD-ROM | disk | FTP | other *** search
/ NeXT Education Software Sampler 1992 Fall / NeXT Education Software Sampler 1992 Fall.iso / Programming / Source / winterp-1.13 / examples / graphcalc1.lsp < prev    next >
Encoding:
Lisp/Scheme  |  1991-10-05  |  4.5 KB  |  141 lines

  1. ; -*-Lisp-*-
  2. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  3. ;
  4. ; File:         graphcalc-options.lsp
  5. ; RCS:          $Header: graphcalc1.lsp,v 1.2 91/10/05 16:02:50 mayer Exp $
  6. ; Description:  Add an "options" button and popup panel for graphcalc.lsp
  7. ; Author:       Niels Mayer, HPLabs
  8. ; Created:      Tue Jul 10 10:35:58 1990
  9. ; Modified:     Sat Oct  5 16:02:39 1991 (Niels Mayer) mayer@hplnpm
  10. ; Language:     Lisp
  11. ; Package:      N/A
  12. ; Status:       X11r5 contrib tape release
  13. ;
  14. ; WINTERP Copyright 1989, 1990, 1991 Hewlett-Packard Company (by Niels Mayer).
  15. ; XLISP version 2.1, Copyright (c) 1989, by David Betz.
  16. ;
  17. ; Permission to use, copy, modify, distribute, and sell this software and its
  18. ; documentation for any purpose is hereby granted without fee, provided that
  19. ; the above copyright notice appear in all copies and that both that
  20. ; copyright notice and this permission notice appear in supporting
  21. ; documentation, and that the name of Hewlett-Packard and Niels Mayer not be
  22. ; used in advertising or publicity pertaining to distribution of the software
  23. ; without specific, written prior permission.  Hewlett-Packard and Niels Mayer
  24. ; makes no representations about the suitability of this software for any
  25. ; purpose.  It is provided "as is" without express or implied warranty.
  26. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  27.  
  28.  
  29. (setq graph_opts_pbw
  30.       (send XM_PUSH_BUTTON_WIDGET_CLASS :new :managed
  31.         "Options" graph_controlpanel_w
  32.         ))
  33.  
  34. (send graph_opts_pbw :set_callback :xmn_activate_callback '()
  35.       '(
  36.     ;; create the dialog if it hasn't been created yet
  37.     (if (null graph_options_dialog_w)
  38.       (setq graph_options_dialog_w (create-graph-options-dialog top_w)))
  39.  
  40.     ;; make it visible
  41.     (send graph_options_dialog_w :popup :grab_none)
  42. ;    (send graph_options_dialog_w :manage)
  43.     ))
  44.  
  45. (progn 
  46.   (setq graph_options_dialog_w nil)
  47.   (defun create-graph-options-dialog (parent_w)
  48.     (let*
  49.     ((dialog_w
  50.       (send TOP_LEVEL_POPUP_SHELL_WIDGET_CLASS :new "graphcalc-options" parent_w
  51.         ))
  52.      (rc_w
  53.       (send XM_ROW_COLUMN_WIDGET_CLASS :new :managed "options_v_rc" dialog_w
  54.         :XMN_ORIENTATION        :vertical
  55.         :XMN_PACKING        :pack_tight
  56.         :XMN_ADJUST_LAST         nil
  57.         :XMN_ENTRY_ALIGNMENT    :alignment_center
  58.         ))
  59. ;     (msg_box_w
  60. ;      (send XM_MESSAGE_BOX_WIDGET_CLASS :new :managed "msg_box_w" dialog_w
  61. ;        ))
  62.      )
  63.  
  64. (setq options_controlpanel_0_w
  65.       (send XM_ROW_COLUMN_WIDGET_CLASS :new :managed "options_controlpanel_0" rc_w
  66.         :XMN_ORIENTATION            :HORIZONTAL
  67.         :XMN_PACKING                :PACK_TIGHT
  68.         :XMN_ADJUST_LAST            nil
  69.         :XMN_ENTRY_ALIGNMENT    :alignment_center
  70.         ))
  71.  
  72. (setq options_controlpanel_1_w
  73.       (send XM_ROW_COLUMN_WIDGET_CLASS :new :managed "options_controlpanel_1" rc_w
  74.         :XMN_ORIENTATION            :HORIZONTAL
  75.         :XMN_PACKING                :PACK_TIGHT
  76.         :XMN_ADJUST_LAST            nil
  77.         :XMN_ENTRY_ALIGNMENT    :alignment_center
  78.         ))
  79.  
  80. (setq childspacing_pbw
  81.       (send XM_PUSH_BUTTON_WIDGET_CLASS :new :managed
  82.         "Set Horizontal Spacing" options_controlpanel_0_w
  83.         ))
  84. (setq  childspacing_slider_w
  85.        (send XM_SCALE_WIDGET_CLASS :new :managed "disp-slider" options_controlpanel_0_w
  86.          :XMN_ORIENTATION        :horizontal
  87.          :XMN_PROCESSING_DIRECTION :MAX_ON_RIGHT 
  88.          :XMN_SENSITIVE        t
  89.          :XMN_SHOW_VALUE        t
  90.          :XMN_MINIMUM        0
  91.          :XMN_MAXIMUM        +100
  92.          :XMN_VALUE        20
  93.          :xmn_width 100
  94.          :xmn_height 100
  95.          ))
  96. (send childspacing_pbw :set_callback :xmn_activate_callback '()
  97.       '(
  98.     (send graph_w :set_values :xmn_child_spacing  (send childspacing_slider_w :get_value))
  99.     ))
  100.  
  101. (setq sibspacing_pbw
  102.       (send XM_PUSH_BUTTON_WIDGET_CLASS :new :managed
  103.         "Set Vertical Spacing" options_controlpanel_0_w
  104.         ))
  105. (setq sibspacing_slider_w
  106.        (send XM_SCALE_WIDGET_CLASS :new :managed "disp-slider" options_controlpanel_0_w
  107.          :XMN_ORIENTATION        :horizontal
  108.          :XMN_PROCESSING_DIRECTION :MAX_ON_RIGHT 
  109.          :XMN_SENSITIVE        t
  110.          :XMN_SHOW_VALUE        t
  111.          :XMN_MINIMUM        0
  112.          :XMN_MAXIMUM        +100
  113.          :XMN_VALUE        20
  114.          :xmn_width 100
  115.          :xmn_height 100
  116.          ))
  117. (send sibspacing_pbw :set_callback :xmn_activate_callback '()
  118.       '(
  119.     (send graph_w :set_values :xmn_sibling_spacing (send sibspacing_slider_w :get_value))
  120.     ))
  121.  
  122. (setq close_pbw
  123.       (send XM_PUSH_BUTTON_WIDGET_CLASS :new :managed
  124.         "Close" options_controlpanel_1_w
  125.         ))
  126.  
  127.        (send close_pbw :set_callback :xmn_activate_callback '()
  128.          `(
  129.            (send ,dialog_w :popdown)
  130.            ))
  131.  
  132.       dialog_w                ;return
  133.       ))
  134.   )
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.